<?php
/**
 * 周舟 hzboye010@163.com
 * addby sublime snippets
 */
namespace Test\Controller;

use Common\Api\BoyeServiceApi;
use Admin\Model\SecurityCodeModel;

class TestWxpayController extends TestController{

  public function index(){

      $this->display();
  }
  /**
   * 获取预微信支付订单号
   * @return [type] [description]
   */
  public function preOrder(){
  	// echo C('API_URL');exit;
  	if(IS_POST){
	 		//T23232323U23P30
      $data = array(
          'code'=> I('post.code',''),
          'desc'=> I('post.desc',''),
          'total_price'=> I('post.total_price',''),
          'api_ver'=>$this->api_ver,
          'notify_id'=>$this->notify_id,
          'type'=>'BY_Wxpay_preOrder',
          'alg'=>'md5',
      );

      $service = new BoyeServiceApi();

      $result = $service->callRemote("",$data,true);
      // dump($result);
      $this->parseResult($result);

    }

    $this->display();
  }

  private function parseResult($result){
    echo "解密后数据：";
    dump($result);
  }
}